#pragma once

#include "Definitions.h"
#include "directx.h"
#include <time.h>

#include "Asteroid.h"
#include "Bullet.h"
#include "Player.h"

#include "LostVector.h"


class Game
{
private:
	time_t now, then, soon;
	float dt;
	Player* p1; 
	Player* p2;

	bool gameOver;
	std::vector<Asteroid*>* asteroidVector;
	//USE THE PLAYER'S BULLET VECTORS TO CHECK AGAINST ASTEROIDS AND PLAYERS.
public:
	Game();
	~Game();

	void Update(InputStruct & isp1, InputStruct & isp2);
	//void AInput(InputStruct is, int pID); //Input struct for given player with the player ID

	void PushIntoDrawStruct(LostVector<DrawStruct>* drawVec);

	void HandleInput();
	void HandleCollisions();

	bool GameOver();

	bool SphericalCollision(XY apos, float aradius, XY bpos, float bradius);

	void CullDeadAsteroidsAndBullets();

	void Open();
	void Close();
};